home *** CD-ROM | disk | FTP | other *** search
-
- #include <Xm/Label.h>
- #include <Xm/CSText.h>
- #include <Xm/RowColumn.h>
-
-
- void
- QuitCB(w, client_data, call_data)
- Widget w;
- XtPointer client_data, call_data;
- {
- exit(0);
- }
-
- void
- PressedCB(w, client_data, call_data)
- Widget w;
- XtPointer client_data, call_data;
- {
- printf("action was: %s\n", (char *) client_data);
- }
-
- int
- main(argc, argv)
- int argc;
- char **argv;
- {
- Widget rowcol;
- Widget button;
- XtAppContext app;
- Widget toplevel;
- Widget cstext;
- XmString str1, str2, str3, str4, str5;
- Arg args[10];
- int n = 0;
- XmString *items;
- XmStringCharSet charSet = XmFONTLIST_DEFAULT_TAG;
-
- toplevel = XtAppInitialize(&app, "XmSend", NULL, 0, &argc, argv,
- NULL, NULL, 0);
-
- rowcol = XmCreateRowColumn(toplevel, "rowcol", NULL, 0);
- XtManageChild(rowcol);
-
- button = XmCreateLabel(rowcol, "top_button", args, n);
- XtManageChild(button);
-
- cstext = XmCreateCSText(rowcol, "text", args, n);
- XtManageChild(cstext);
-
- str1 = XmStringSegmentCreate("hi there", charSet,
- XmSTRING_DIRECTION_L_TO_R, True);
- str2 = XmStringDirectionCreate(XmSTRING_DIRECTION_R_TO_L);
- str3 = XmStringConcatAndFree(str1, str2);
-
- str4 = XmStringSegmentCreate("back again", charSet,
- XmSTRING_DIRECTION_R_TO_L, True);
- str5 = XmStringConcatAndFree(str3, str4);
-
- XtVaSetValues(button, XmNlabelString, str5, NULL);
- XtVaSetValues(cstext, XmNcstextValue, str5, NULL);
-
- XtRealizeWidget(toplevel);
-
- XtAppMainLoop(app);
- }
-